home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload Trio 2 / Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO / dir36 / batcmd94.zip / USEBATS.WHY < prev    next >
Text File  |  1991-05-27  |  7KB  |  279 lines

  1.  
  2.  
  3.                             USE BATs,
  4.  
  5.                           by Don Hinds
  6.  
  7.     Especially  if you have a hard disk. They save  time,  typing 
  8.  
  9. and do it faster than you can. In fact there are only 2 drawbacks 
  10.  
  11. to  using  bat  files. One, is you often get so  many  you  can't 
  12.  
  13. remember  what  the  bat with that short name  does.  The  second 
  14.  
  15. drawback is that every file, no matter how small, takes at  least 
  16.  
  17. 2K  of  disk space. A 12 byte file takes the same space  as  2024 
  18.  
  19. bytes.  I  have  written  a program  to  solve  number  two.  All 
  20.  
  21. (almost) your bat files can go into a single ASCII list. It  also 
  22.  
  23. solves the first objection.
  24.  
  25.     But why use bat files? As you begin to fill up your hard disk 
  26.  
  27. you'll  find yourself with many directories, and  subdirectories. 
  28.  
  29. At  least  you should. Because the more  directories  the  better 
  30.  
  31. organized the disk (up to a point). But changing between them  is 
  32.  
  33. a  chore. And then checking to see if what you're looking for  is 
  34.  
  35. in  'this  one'. A bat file simplifies this. A one  or  2  letter 
  36.  
  37. command  will do the whole job. My UTIL directory has 3  subdirs. 
  38.  
  39. DAIG  for diagnose, DIAGM for model M diags, and BAK  for  little 
  40.  
  41. used utilities. So this complete set looks like this.
  42.  
  43. C:\UTIL
  44. C:\UTIL\BAK
  45. C:\UTIL\DAIG
  46. C:\UTIL\DIAGM
  47.  
  48. Changing between them and getting a DIR takes 
  49.  
  50. C:>cd \util\bak
  51. C:\UTIL\BAK>dir/w
  52.  
  53. and so forth.
  54.  
  55.  
  56.  
  57.  
  58.     Now  I had 4 bat files each with a 2 letter name. UT, UB,  UD 
  59.  
  60. and  UM. Typing just the two letters would change the  dir/subdir 
  61.  
  62. and display the directory. As your directories grow you will find 
  63.  
  64. this more and more useful.
  65.  
  66.     You  can also run programs from a bat file. No doubt you  have 
  67.  
  68. set  a  PATH  for  command.com to look  for  programs.  But  some 
  69.  
  70. programs  like  Procomm  have associated  files.  There  are  the 
  71.  
  72. telephone list, parameters and so forth. They must be present  to 
  73.  
  74. operate  Procomm.  So putting the DIR with Procomm  in  the  PATH 
  75.  
  76. doesn't  work. But a bat file (pro) will change  directories  and 
  77.  
  78. run Procomm. You use an editor that will write ASCII files to  do 
  79.  
  80. your bat. The I keep Procomm in the dir \COM. So this simple  bat 
  81.  
  82. takes you to \COM and runs Procomm with just 'pro'.
  83.  
  84. cd\com
  85. procomm
  86.  
  87.     You  name  it PRO.BAT. 
  88.  
  89. If you have Wordstar 4 (WS)  it  comes with Wordfinder (WF). This 
  90.  
  91. is is the thesaurus. I have 2 bats for Wordstar.  One  goes to the 
  92.  
  93. WS directory and loads only  WS.  The other loads WF first then 
  94.  
  95. WS.
  96.  
  97. (ws.bat)
  98.  
  99. cd\ws
  100. ws
  101.  
  102. (ws+.bat)
  103.  
  104. cd/ws
  105. wf
  106. ws
  107.  
  108.     You  can have it do something when you are finished also.  In 
  109.  
  110. my  'pro.bat' I added the command to changedir to \DWN  and  show 
  111.  
  112. the directory. I have Procomm set do put downloads into \DWN.  So 
  113.  
  114. here is the new PRO.BAT
  115.  
  116. cd\com
  117. procomm
  118. cd\dwn
  119. dir/w
  120.  
  121.     When  you are finished with Procomm you will see the list  of 
  122.  
  123. files in the dir \DWN where your new downloads are.
  124.  
  125.  
  126.  
  127.     While this is more to show WHY to use bats, I must include  a 
  128.  
  129. short  note on more advanced bats. You may also  use  parameters. 
  130.  
  131. Here  is  a very simple example. You can make a bat to  copy  for 
  132.  
  133. you.  It  is almost as long as the copy command and  is  just  to 
  134.  
  135. illustrate parameter use. The copy command is
  136.  
  137. COPY "from" "to"
  138.  
  139. C:>copy *.txt b:*.doc    (copies all TXT to B and renames to DOC)
  140.  
  141. You 'can' make a bat called 'c' to do this.
  142.  
  143. (c.bat)
  144.  
  145. copy %1 %2
  146. dir %3
  147.  
  148. To use type
  149.  
  150. C:>c *.txt b:*.doc b:
  151.  
  152. 'c' is the bat. %1 = '*.txt'. %2 = 'b:*.doc". %3 = 'b:'
  153.  
  154. So you can do a LOT with bat files and save typing and time.
  155.  
  156.     So I wrote a program to save the disk space my 40+ bats  took 
  157.  
  158. up.  That's over 80K of space! And the total bytes was less  than 
  159.  
  160. 3K.  It is called Bat Commander. The actual program is Z.COM.  It 
  161.  
  162. is  slightly longer to use than 'normal' bats. Because  you  must 
  163.  
  164. name  each bat with at least a 2 letter name, and use the  Z.  My 
  165.  
  166. 'pro' bat in the ascii list is identical to the one above. To use 
  167.  
  168. it I type,
  169.  
  170. z pro
  171.  
  172.     The difference in making the bat is that ALL of the bats  are 
  173.  
  174. in  a  single  long list. They are separated by  'END'.  And  the 
  175.  
  176. name  of the bat is in the list. The 'pro' bat in the list  looks 
  177.  
  178. like this.
  179.  
  180. END
  181. pro
  182. cd\com
  183. procomm
  184. cd\dwn
  185. dir/w
  186. END
  187.  
  188.  
  189. The bats may be listed, contents listed etc. with Bat Commander.
  190.  
  191.  
  192.     This hopefully will get you to use bats, and also my program.
  193.  
  194. Look for BATCMDxx.ZIP (where 'xx' is the latest version).
  195.  
  196.  
  197.  
  198.                         HINTS
  199.  
  200.      THere are several programs that I depend upon and should be in 
  201.  
  202. every 'kit' for hard disk users.
  203.  
  204. LIST - Replaces type. Allows forward and reverse scrolling and more.
  205.  
  206. PKZIP/PKUNZIP- The tool(s) for ZIPing and UNZIPing libraries.
  207.  
  208. SHEZ - For looking into ZIPs and viewing text. Also remove single file 
  209.      etc.
  210.  
  211. DR, RN and CO - From PC Magazine. They are for moving between DIRs and 
  212.      move, copy, rename etc etc.
  213.  
  214. VDE - A very nice editor. Originally for CPM. Shows return marks '<' 
  215.      so is great for editing Z.FLS (for Bat Commander).
  216.  
  217. EDIT - Editor if you can't find VDE.
  218.  
  219. FLUSH - (with FLMK) puts a 'mark' in RAM so you can FLUSH resident 
  220.      programs when finished.
  221.  
  222. MAP - Shows programs in RAM and room left.
  223.  
  224. XEQ - You put those small COMs 'into' XEQ and save disk space.
  225.  
  226. MV - moves files between DIRs
  227.  
  228. SRxx - Still River shell
  229.  
  230.  
  231.      I used to have DOC subdirectories for each major section. Like 
  232. \DOS, \UTIL, would have \DOS\DOC, \UTIL\DOC etc. But I have put all 
  233. the docs for each into an ZIP. With Bat Commander and SHEZ I can look 
  234. at them from anywhere on the disk.  To see the DOSDOC.ZIP, I type 
  235. 'z doc'. And for the UTILDOC.ZIP 'z ud'. The bat file changes to the 
  236. proper DIR, calls SHEZ to look at the ZIPed doc file. When I'm done 
  237. I'm returned to the original DIR all automatically. Example;
  238.  
  239. (UD  bat in Z.FLS)
  240.  
  241. END
  242. ud
  243. shez \util\utildoc.zip
  244. END
  245.  
  246. You type 4 chars (z ud) instead of 22. (shez \util\utildoc.zip). 
  247.  
  248. Which is not only faster, but less chance to mistype. You can of 
  249.  
  250. course, have UD.BAT with the single line 'shez \util\utildoc.zip'. 
  251.  
  252. But that takes 2K of disk space, and in Z.FLS takes a total of 30 
  253.  
  254. bytes! (including END and returns etc). (a plug for using Bat 
  255.  
  256. Commander)
  257.  
  258.  
  259. I hope you see the wisdom of using bats and of course, Bat Commander. 
  260.  
  261. Perhaps I have given you some insight and ideas in their use. I also 
  262.  
  263. find that editing bats is much easier with Z.FLS because the bats are 
  264.  
  265. all in one place. Where you would normally have them in every 
  266.  
  267. directory and hard to find the one to edit.
  268.  
  269.  
  270.          ************************************************************
  271.          *                                                          *
  272.          *    If you find Bat Commander useful  please send $5 to:  *
  273.          *                                              you         *
  274.          *           CASTLEsoft                          can        *
  275.          *           3 Draper Castle                      afford    *
  276.          *           Dorchester Mass. 02122                five $   *
  277.          *                                                          *
  278.          ************************************************************
  279.